#pragma once

#ifndef _CITEM_H_
#define _CITEM_H_

// Item types for m_type
#define ITEM_NORMAL		0x00

// Item inventory types
#define ITEM_GENERAL	0x01
#define ITEM_USABLE		0x02
#define ITEM_PUPPET		0x03
#define ITEM_ARMOR		0x04
#define ITEM_WEAPON		0x05
#define ITEM_CURRENCY	0x06  // Not used

// Equipment values for slotID
#define SLOT_MAIN		0x00
#define SLOT_OFF		0x01
#define SLOT_RANGED		0x02
#define SLOT_AMMO		0x03
#define SLOT_HEAD		0x04
#define SLOT_BODY		0x05
#define SLOT_HANDS		0x06
#define SLOT_LEGS		0x07
#define SLOT_FEET		0x08
#define SLOT_NECK		0x09
#define SLOT_WAIST		0x0A
#define SLOT_EAR1		0x0B
#define SLOT_EAR2		0x0C
#define SLOT_RING1		0x0D
#define SLOT_RING2		0x0E
#define SLOT_BACK		0x0F
#define SLOT_LINKSHELL	0x10

class CItem
{
public:
		
	CItem(void);
	~CItem(void);

	void setId(unsigned short id);
	unsigned short getId(void);

	void setType(unsigned char type);
	unsigned char getType();

	void setInvType(unsigned char type);
	unsigned char getInvType();

	void setQuantity(unsigned long quantity);
	unsigned long getQuantity(void);

	void setStackSize(unsigned char stackSize);
	unsigned char getStackSize();

	void setSignName(unsigned char * name);
	char * getSignName(void);
	char * getSignNameComp(void);

	void setSellPrice(unsigned long sellPrice);
	unsigned long getSellPrice();

	void setMessage(unsigned short message);
	unsigned short m_message;
	void setAnimation(unsigned short animation);
	unsigned short m_animation;

	short m_paramtwo;

	void setAttributes();

	unsigned short getAllowedTargets();
	char * getItemName(void);

	unsigned short getDelay();

	bool m_canRemove;


private:
	unsigned short m_id;
	unsigned char m_type;
	unsigned char m_invType;

	unsigned long m_quantity;
	unsigned char m_stackSize;

	//SIGNED
	char m_signName[16];
	// compressed sign name for packets
	char m_signNameComp[12];
	void compressSignName(char * inputUncomp, char * outputComp);

	unsigned long m_sellPrice;

	unsigned short m_allowedTargets;
	unsigned short m_delay;
	char m_name[20];

};

#endif